package speed;

public class DveUse {
	public static void main(String[] args) {
		System.out.println("----------------------");
		System.out.println("Division method");
		System.out.println(10/3);
		System.out.println(10.0/3);//以大类型为主，double精度大于int
		double b = 10/3;//b先是整数3，后转为3.0
		System.out.println(b);
		System.out.println("----------------------");
		System.out.println("Delivery method");
		System.out.println(10%3);
		System.out.println("10-(10/3*3=10-(3*3)=1");
		System.out.println("----------------------");
		System.out.println(-10%-3);
		System.out.println("-10-(-10/-3*-3=-10-(-3*-3)=-1");
		System.out.println("----------------------");
		System.out.println(-10%3);
		System.out.println("-10-(-10/3*3=-10-(-3*3)=-1");
		System.out.println("----------------------");
		System.out.println(10%-3);
		System.out.println("10-(10/-3*-3=10-(3*3)=1");
		System.out.println("所以取模运算的时候结果正负取决于被模数，即%左边的数");
		System.out.println("----------------------");
		
	}

}
